<?php echo getModuleDemo(0, $item['id'], 0, 11, $item['button'], $buttons_params, $buttons_params); ?>
<input type="hidden" name="action" value="editor" />
<input type="hidden" name="item" value="<?php echo $item['id']; ?>" />
<fieldset>
	<dl>
		<dt>Name:</dt>
		<dd>
			<input name="name" type="text" value="<?php echo $item['name']; ?>" style="width:30%">
			&nbsp;<?php echo $NameStatus; ?>
			<input type="submit" value="Save" style="padding-left:20px; padding-right:10px;  background-image: url('../images/system/save.gif'); border:1px solid #DDDDDD; height:20px;" class="buttons">
		</dd>
	</dl>
	<dl>
		<dt>Height:</dt>
		<dd>
			<select name="height">
				<?php 
					$i=1;
					while($i <= 200)
					{
						if ($i == $item['height'])
						{
							echo '<option value="'.$i.'" selected>'.$i.' px</option>';
						}
						else
						{
							echo '<option value="'.$i.'">'.$i.' px</option>';
						}
						$i ++;
					}
				?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Image font:</dt>
		<dd>
			<select style="width:70px;" name="imagefont" onchange="submit();">
				<option value="0" <?php if ($item['imagefont'] == 0){echo 'selected'; }?>>No</option>
				<option value="1" <?php if ($item['imagefont'] == 1){echo 'selected'; }?>>Yes</option>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Left Image: <?php echo $item['l_image']; ?></dt>
		<dd>
			<input id="l_image" name="l_image" type="file" ></input>
			<?php 
				if($item['l_image'] != "")
				{
					$size = getimagesize(HEADERS_PATH.$item['l_image']); 
					$fp = fopen(HEADERS_PATH.$item['l_image'], "rb");
					if ($size && $fp) 
					{
						echo $size[0]." x ";
						echo $size[1]." px ";
					}
				}
				echo $lImageStatus;
			?>
			<?php if($item['l_image'] != "") { ?>
				<input type="checkbox" name="delete_l" value="1"><strong>(Delete Left)</strong>
			<?php } ?>
		</dd>
	</dl>
	<dl>
		<dt>Background Image: <?php echo $item['image']; ?></dt>
		<dd>
			<input id="image" name="image" type="file" value=""></input>
			<?php 
				if($item['image'] != "")
				{
					$size = getimagesize(HEADERS_URL.$item['image']); 
					$fp = fopen(HEADERS_PATH.$item['image'], "rb");
					if ($size && $fp) 
					{
						echo $size[0]." x ";
						echo $size[1]." px ";
						//echo $size[2];
						//echo $size[3];
					}
				}
				echo $ImageStatus;
			?>
			<?php if($item['image'] != "") { ?>
					<input type="checkbox" name="delete_bg" value="1"><strong>(Delete Background)</strong>
			<?php } ?>
		</dd>
	</dl>
	<dl>
		<dt>Background Image 2: <?php echo $item['image2']; ?></dt>
		<dd>
			<input id="image2" name="image2" type="file" value=""></input>
			<?php 
				if($item['image2'] != "")
				{
					$size = getimagesize(HEADERS_URL.$item['image2']); 
					$fp = fopen(HEADERS_PATH.$item['image2'], "rb");
					if ($size && $fp) 
					{
						echo $size[0]." x ";
						echo $size[1]." px ";
						//echo $size[2];
						//echo $size[3];
					}
				}
				echo $ImageStatus;
			?>
			<?php if($item['image2'] != "") { ?>
					<input type="checkbox" name="delete_bg2" value="1"><strong>(Delete Background 2)</strong>
			<?php } ?>
		</dd>
	</dl>
	<dl>
		<dt>Right Image: <?php echo $item['r_image']; ?></dt>
		<dd>
			<input id="r_image" name="r_image" type="file" value=""></input>
			<?php 
				if($item['r_image'] != "")
				{
					$size = getimagesize(HEADERS_PATH.$item['r_image']); 
					$fp = fopen(HEADERS_PATH.$item['r_image'], "rb");
					if ($size && $fp) 
					{
						echo $size[0]." x ";
						echo $size[1]." px ";
					}
				} 
				echo $rImageStatus;
			?>
			<?php if($item['r_image'] != "") { ?>
				<input type="checkbox" name="delete_r" value="1"><strong>(Delete Right)</strong>
			<?php } ?>
		</dd>
	</dl>
	<dl>
		<dt>Default Button:</dt>
		<dd>
			<select name="button" onchange="submit();">
				<option value="0">None</option>
				<?php 
				if($buttons)
				{
					foreach($buttons as $button)
					{
						if($item['button'] == $button['id'])
						{
							echo '<option value="'.$button['id'].'" selected="selected">'.$button['name'].'</option>';
						}
						else
						{
							echo '<option value="'.$button['id'].'" >'.$button['name'].'</option>';
						}
					}
				}
				?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Default Icon Set:</dt>
		<dd>
			<select name="icon" onchange="submit();">
				<option value="0">None</option>
				<?php 
				if($iconsets)
				{
					foreach($iconsets as $iconset)
					{
						if($item['icon'] == $iconset['id'])
						{
							echo '<option value="'.$iconset['id'].'" selected="selected">'.$iconset['name'].'</option>';
						}
						else
						{
							echo '<option value="'.$iconset['id'].'" >'.$iconset['name'].'</option>';
						}
					}
				}
				?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>Edit Header Style</dt>
		<dd>&nbsp;</dd>
	</dl>
	<table cellpadding="0" cellspacing="0" border="1" style="cursor:pointer; width:100%; background-color:#EEEEEE; height:30px;">
		<tr>
			<?php if($item['l_image'] != ''): ?>
			<td id="board_1" rowspan="4" onclick="setVisible('ch_left'); toggleClassName(this.id, 'board_active');" align="center" style="width:60px; border-right:1px solid #CCCCCC;">Left Bg Image</td>
			<?php endif; ?>
			<td id="board_2" colspan="5" onclick="setVisible('ch_center'); toggleClassName(this.id, 'board_active');" align="center">Center Area (header bg and height)</td>
			<?php if($item['r_image'] != ''): ?>
			<td id="board_3" rowspan="4" onclick="setVisible('ch_right'); toggleClassName(this.id, 'board_active');" align="center" style="width:60px; border-left:1px solid #CCCCCC;">Right Bg Image</td>
			<?php endif; ?>
		</tr>
		<tr>
			<td id="board_4" rowspan="2" align="center" onclick="setVisible('ch_icon'); toggleClassName(this.id, 'board_active');">Icon Area </td>
			<td id="board_10" colspan="3" align="center" onclick="setVisible('h2'); toggleClassName(this.id, 'board_active');" style="border-right:1px solid #CCCCCC;">Text Areas</td>
			<td id="board_8" rowspan="2" align="center" onclick="setVisible('ch_buttons'); toggleClassName(this.id, 'board_active');">Button Area</td>
		</tr>
		<tr>
			<td id="board_5" align="center" onclick="setVisible('ch_txt'); toggleClassName(this.id, 'board_active');" style="border-right:1px solid #CCCCCC;">Text 1 Area</td>
			<td id="board_6" align="center" onclick="setVisible('ch_txt2'); toggleClassName(this.id, 'board_active');" style="border-right:1px solid #CCCCCC;">Text 2 Area</td>
			<td id="board_7" align="center" onclick="setVisible('ch_txt3'); toggleClassName(this.id, 'board_active');" style="border-right:1px solid #CCCCCC;">Text 3 Area</td>
		</tr>
		<tr>
			<td id="board_9" colspan="5" onclick="setVisible('ch_content'); toggleClassName(this.id, 'board_active');" align="center">Content Area (Container of text icons and buttons)</td>
		</tr>
	</table>
    <?php 
	$style['ch'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].'');
	if($style['ch'] == '')
	{ $style['ch'] = '';}
	?>
    <dl>
		<dt>div.com_header div.ch_<?php echo $item['id']; ?></dt>
		<dd>
			<textarea name="ch" style="width:50%; height:60px;"><?php echo $style['ch']; ?></textarea>
		</dd>
	</dl>
	<?php 
	if($item['l_image'] != ''):
	$style['ch_left'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].' div.ch_left');
	if($style['ch_left'] == '')
	{ $style['ch_left'] = 'padding-left:'.$size_l[0].'px; background-image:url(images/'.$item['l_image'].');';}
	?>
	<dl id="ch_left" style="display:none;">
		<dt>div.com_header div.ch_<?php echo $item['id']; ?> div.ch_left</dt>
		<dd>
			<textarea name="ch_left" style="width:50%; height:120px;"><?php echo $style['ch_left']; ?></textarea>
		</dd>
	</dl>
	<?php endif; ?>
	<?php 
	if($item['r_image'] != ''):
	$style['ch_right'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].' div.ch_right');
	if($style['ch_right'] == '')
	{ $style['ch_right'] = 'padding-right:'.$size_r[0].'px; background-image:url(images/'.$item['r_image'].');';}
	?>
	<dl id="ch_right" style="display:none;">
		<dt>div.com_header div.ch_<?php echo $item['id']; ?> div.ch_right</dt>
		<dd>
			<textarea name="ch_right" style="width:50%; height:120px;"><?php echo $style['ch_right']; ?></textarea>
		</dd>
	</dl>
	<?php endif; ?>
	<?php 
	$style['ch_center'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].' div.ch_center');
	if(($item['image'] != '') && ($style['ch_center'] == ''))
	{ $style['ch_center'] = 'height:'.$item['height'].'px; background-image:url(images/'.$item['image'].');';}
	?>
	<dl id="ch_center" style="display:none;">
		<dt>div.com_header div.ch_<?php echo $item['id']; ?> div.ch_center</dt>
		<dd>
			<textarea name="ch_center" style="width:50%; height:120px;"><?php echo $style['ch_center']; ?></textarea>
		</dd>
	</dl>
	<?php 
	$style['ch_content'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].' div.ch_content');
	if(($style['ch_content'] == '') && ($item['image2'] != ''))
	{ $style['ch_content'] = 'height:'.$item['height'].'px; background-image:url(images/'.$item['image2'].'); repeat:no-repeat;';}
	?>
	<dl id="ch_content" style="display:none;">
		<dt>div.com_header div.ch_<?php echo $item['id']; ?> div.ch_content</dt>
		<dd>
			<textarea name="ch_content" style="width:50%; height:120px;"><?php echo $style['ch_content']; ?></textarea>
		</dd>
	</dl>
	<?php 
	$style['ch_icon'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].' .ch_icon');
	if($style['ch_icon'] == '')
	{ $style['ch_icon'] = 'float:left;';}
	?>
	<dl id="ch_icon" style="display:none;">
		<dt>div.com_header div.ch_<?php echo $item['id']; ?> .ch_icon</dt>
		<dd>
			<textarea name="ch_icon" style="width:50%; height:120px;"><?php echo $style['ch_icon']; ?></textarea>
		</dd>
	</dl>
	<?php 
	$style['h2'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].' h2');
	if($style['h2'] == '')
	{ $style['h2'] = 'float:left;';}
	?>
	<dl id="h2" style="display:none;">
		<dt>div.com_header div.ch_<?php echo $item['id']; ?> h2</dt>
		<dd>
			<textarea name="h2" style="width:50%; height:120px;"><?php echo $style['h2']; ?></textarea>
		</dd>
	</dl>
	<?php 
	$style['ch_txt'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].' .ch_txt');
	if($style['ch_txt'] == '')
	{ $style['ch_txt'] = 'float:left;';}
	?>
	<dl id="ch_txt" style="display:none;">
		<dt>div.com_header div.ch_<?php echo $item['id']; ?> .ch_txt</dt>
		<dd>
			<textarea name="ch_txt" style="width:50%; height:120px;"><?php echo $style['ch_txt']; ?></textarea>
		</dd>
	</dl>
	<?php 
	$style['ch_txt2'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].' .ch_txt2');
	if($style['ch_txt2'] == '')
	{ $style['ch_txt2'] = 'float:left;';}
	?>
	<dl id="ch_txt2" style="display:none;">
		<dt>div.com_header div.ch_<?php echo $item['id']; ?> .ch_txt2</dt>
		<dd>
			<textarea name="ch_txt2" style="width:50%; height:120px;"><?php echo $style['ch_txt2']; ?></textarea>
		</dd>
	</dl>
	<?php 
	$style['ch_txt3'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].' .ch_txt3');
	if($style['ch_txt3'] == '')
	{ $style['ch_txt3'] = 'float:left;';}
	?>
	<dl id="ch_txt3" style="display:none;">
		<dt>div.com_header div.ch_<?php echo $item['id']; ?> .ch_txt3</dt>
		<dd>
			<textarea name="ch_txt3" style="width:50%; height:120px;"><?php echo $style['ch_txt3']; ?></textarea>
		</dd>
	</dl>
	<?php 
	$style['ch_buttons'] = getStyleCss(1, $item['id'], 'div.com_header div.ch_'.$item['id'].' .ch_buttons');
	if($style['ch_buttons'] == '')
	{ $style['ch_buttons'] = 'float:right;';}
	?>
	<dl id="ch_buttons" style="display:none;">
		<dt>div.com_header div.ch_<?php echo $item['id']; ?> .ch_buttons</dt>
		<dd>
			<textarea name="ch_buttons" style="width:50%; height:120px;"><?php echo $style['ch_buttons']; ?></textarea>
		</dd>
	</dl>
	<dl>
		<dt>Header Categories:</dt>
		<dd>
			<select size="10" name="hfb_cats" style="width:20%;">
				<?php 
				if($hfbcats)
				{
					foreach($hfbcats as $hfbcat)
					{
						echo '<option ondblclick="edit_form.add_to_cat.value=this.value; edit_form.submit();" value="'.$hfbcat['id'].'">'.$hfbcat['title'].'</option>';
					}
				}
				?>
			</select>
			<select size="10" name="hfb_in_cats" style="width:20%;">
				<?php 
				if($incats)
				{
					foreach($incats as $incat)
					{
						echo '<option ondblclick="edit_form.rem_from_cat.value=this.value; edit_form.submit();" value="'.$incat['id'].'">'.$incat['title'].'</option>';
					}
				}
				?>
			</select>
			<input type="hidden" id="add_to_cat" name="add_to_cat" value="0" />
			<input type="hidden" id="rem_from_cat" name="rem_from_cat" value="0" />
		</dd>
	</dl>
</fieldset>